package lab02.test13;

public class Gymnastics extends ComputerAverage {
    int average;

    public void average(int score1, int score2, int score3, int score4) {
        int arr[] = {score1, score2, score3, score4};
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int temp;
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }

            }
        }
        average = (arr[1] + arr[2]) / 2;


    }
}
